<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/include/taglibs.jsp" %>
<html>
<head>
    <%@include file="/include/header.html" %>
    <script type="text/javascript" src="${ctx}/appjs/invite/inviteTicketList.js"></script>
    <link rel="stylesheet" href="${ctx}/statics/css/update.css">
    <link rel="stylesheet" href="${ctx}/statics/css/common.css">
    <link rel="stylesheet" href="${ctx}/libjs/plugins/laydate/laydate.css">
    <script src="${ctx}/libjs/plugins/laydate/laydate.js"></script>
    <style>
        body {
            /*overflow: hidden !important;*/
        }

        .seach-box {
            height: 200px;
            border: 1px solid #eee;
            padding-left: 15px;
            padding-top: 10px;
            margin-top: 10px;
        }

        .connectivity_inner_seach, .connectivity_seach {
            padding-left: 0;
            padding-top: 0px;
            overflow: auto;
        }

        .seach-box ul {
            height: 100%;
            width: 100%;
            overflow: auto;
        }

        .seach-box ul li {
            padding-top: 3px;
            display: flex;
        }

        .layui-form-checkbox i {
            height: 30px;
        }

        .layui-checkbox-disbaled span {
            background-color: #5FB878 !important;
        }

        .hide {
            display: none !important;
        }
        .layui-form-select dl{
            /*top: 0;*/
        }
        .searchable-select-items{
            max-height: 250px;
        }
        .searchable-select{
            margin-left: 0 !important;
            width: 100% !important;
        }
    </style>
</head>

<script type="text/javascript">
    $('#topLink', window.parent.document).html(function (i, origText) {
        return '<ol class="breadcrumb">' +
            '<li class="breadcrumb-item">' +
            '<a href="">主页</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a>运营管理</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<strong>新增邀请新用户得优惠券</strong>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a href="javascript:window.history.back()"><i class="fa fa-times"></i> 返回</a>' +
            '</li>' +
            '</ol>';
    });

</script>

<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <div class="columns pull-left">
                        <h5 class="font-bold">新增邀请新用户得优惠券</h5>
                    </div>
                    <div class="ibox-tools">
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content" style="height: 762px">
                <form class="form-horizontal m-t " id="frmTenantTicketType">
                    <input type="hidden" name="inviteSettingId" id="inviteSettingId"
                           value="${memberInviteSetting.inviteSettingId}">
                    <div class="form-group row">
                        <label class="col-sm-3 col-form-label text-right">活动类型：</label>
                        <div class="col-sm-4">
                            <select class="form-control" readonly="true">
                                <option value="0" selected>邀请新用户得优惠券</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-sm-3 col-form-label text-right">活动名称：</label>
                        <div class="col-sm-4">
                            <input type="text" class="form-control" id="inviteName" name="inviteName"/>
                        </div>
                        <span style="display: inline;color: #888888">*活动名称仅作为标记区分使用,可放心填写</span>
                    </div>
                    <div class="form-group row">
                        <label class="col-sm-3 col-form-label text-right">活动开始时间：</label>
                        <div class="col-sm-4">
                            <input class="form-control" id="beginTime" name="beginTime">
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-sm-3 col-form-label text-right">活动结束日期：</label>
                        <div class="col-sm-4">
                            <input class="form-control" id="endTime" name="endTime">
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-sm-3 col-form-label text-right">奖励类型：</label>
                        <div class="col-sm-5">
                            <select id="inviteType" name="inviteType" class="form-control" readonly="true">
                                <option value="2" selected>赠送优惠券</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-sm-3 col-form-label text-right">赠送对象：</label>
                        <div class="col-sm-4">
                            <select class="form-control" readonly="true">
                                <option selected>邀请者</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-sm-3 col-form-label text-right">关联优惠券：</label>
                        <div class="col-sm-4">
                            <select class="form-control ticketTypeId" name="ticketTypeId" lay-filter="ticketTypeId" id="ticketTypeId">
                                ${ticketSelect}
                            </select>
                        </div>
                        <span style="display: inline;color: #888888">*选择您想要赠送的优惠券,仅可选数量为无限制的</span>
                    </div>

                    <div class="form-group row">
                        <label class="col-sm-3 col-form-label text-right">奖品内容：</label>
                        <div class="col-sm-4">
                            <input type="text" class="form-control ticketContent"  readonly>
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-sm-3 col-form-label text-right">单次赠送数量：</label>
                        <div class="col-sm-4">
                            <input type="text" maxlength="2" id="ticketTypeCount" name="ticketTypeCount" class="form-control"/>
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-sm-3 col-form-label text-right">活动规则描述:</label>
                        <div class="col-sm-5">
                            <textarea class="form-control" id="ruleRemark" name="ruleRemark"
                            ></textarea>
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-sm-3 col-form-label text-right">邀请描述<br>(不多于50字):</label>
                        <div class="col-sm-5">
                            <textarea class="form-control" maxlength="50" id="inviteRemark" name="inviteRemark"
                            ></textarea>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-3 col-sm-offset-8 text-right">
                            <button type="submit" class="btn btn-primary">提交</button>
                        </div>
                    </div>
                </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    addInviteTicket.init();
</script>
</body>
</html>
<script>

    layui.use(['form', 'jquery', 'tree', 'laydate', 'util'], function () {

        var form = layui.form;
        var $ = layui.jquery;
        // //打折与立减切换
    })
    $('#ticketTypeId').searchableSelect();
    $("#ticketTypeId").change(function (e) {
        var ticketName  = ($(this).find("option:checked").attr("data-ticketName"))
        $(".ticketContent").val(ticketName)
    })
    //获取初始选中的优惠券内容
    $(".ticketContent").val($("#ticketTypeId option:selected").attr("data-ticketname"))

    //日期范围限制
    var start = {
        elem: '#beginTime',
        format: 'YYYY-MM-DD hh:mm:ss',
        // theme: '#3195f0',
        // min: laydate.now(), //设定最小日期为当前日期
        // max: '2099-06-16 23:59:59', //最大日期
        istime: true,
        istoday: false,
        choose: function (datas) {
            $("#endTime").val("")
            end.min = datas
        }
    };
    var end = {
        elem: '#endTime',
        format: 'YYYY-MM-DD hh:mm:ss',
        // theme: '#3195f0',
        // min: laydate.now(),
        // max: '2099-06-16 23:59:59',
        istime: true,
        istoday: false,
        choose: function (datas) {
            start.max = datas; //结束日选好后，重置开始日的最大日期
        }
    };
    laydate(start);
    laydate(end);
    laydate.skin('molv');//皮肤
</script>

